﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace HzyAdmin.Areas.Admin.Controllers.Sys
{
    //
    using Aop;
    using Common;
    using Models.SysClass;
    using Logic.SysClass;
    using DbFrame.Class;
    using System.Collections;

    public class RoleFunctionController : BaseController
    {
        // 角色功能
        // GET: /ManageSys/RoleFunction/
        public Sys_RoleMenuFunctionLogic _Sys_RoleMenuFunctionLogic = new Sys_RoleMenuFunctionLogic();

        protected override void Init()
        {
            this.MenuID = "Z-140";
        }

        public override ActionResult Index()
        {
            return View(db.FindList<Sys_Role>(null, orderby => new { orderby.Role_Num }));
        }
        #region  基本操作，增删改查

        /// <summary>
        /// 获取角色菜单功能
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public ActionResult GetRoleMenuFunctionTree(string Id)
        {
            return this.Success(new
            {
                status = 1,
                value = _Sys_RoleMenuFunctionLogic.GetRoleMenuFunctionZTree(Id.ToGuid())
            });
        }

        /// <summary>
        /// 保存角色功能
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult Save(string Sys_RoleMenuFunction_List, string RoleId)
        {
            _Sys_RoleMenuFunctionLogic.SaveFunction(Sys_RoleMenuFunction_List, RoleId.ToGuid());
            return this.Success();
        }
        #endregion 基本操作，增删改查
    }
}
